<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 
<%@page import="com.git.report.ReportModelImpl"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>报告编写</title>
<style type="text/css">

	* { padding:0; font-size:12px;  color:#444;}
	
	body { margin:5;}

	table { border-bottom: 1px solid #CCC; border-right: 1px solid #CCC; margin:5px auto;}

	td { border-top: 1px solid #CCC; border-left: 1px solid #CCC; padding-top:5px; padding-bottom:5px; padding-left:5px; height:22px; line-height:22px;}

	input[type="text"] { border: 1px solid #CCC; height:20px; background:#FFD}

	input[type="submit"] { font-size:12px; width: 90px; height:28px; margin-left:20px;}
	input[type="button"] { font-size:12px; width: 90px; height:28px; margin-left:20px;}
	input[type="radio"] { font-size:12px; width: 70px; height:28px; margin-left:20px;}
	input[type="checkbox"] { border: 1px solid #CCC; height:20px; background:#FFD}
	select {height:24px; border:1px solid #8ac;}

	textarea{font-size:12px; width: 190px; height:88px; margin-left:20px;background:#FFD}
	h2.title { font-weight:normal; margin-left:10px; margin-top:3px;}

	div.board { margin:5px; border:1px solid #CCC;}

</style>
<script type="text/javascript">

function show(modelCode){
	window.open('<%=request.getContextPath() %>/ReportModelServlet?method=edit&openword=1&modelCode='+modelCode, '_blank');
}

function findReport(reportPath){
	
	var url = "http://172.16.3.101:8080"+reportPath;
	window.open(url,'_blank');
}

function findMark(markCode,sessionId){
	
	var url = "http://172.16.3.101:8080/Portal_CR/HTML/afdb_connection.jsp?reportId=122&markcode="+markCode+"&sessionId="+sessionId;
	window.open(url,'_blank');
}

function url(modelCode){
	window.location.href="<%=request.getContextPath() %>/downloadfile?method=downloadfile&modelCode="+modelCode;
}

function fileurl(modelCode){
	window.location.href="<%=request.getContextPath() %>/downloadfile?method=downloadfile&fileurl=true&modelCode="+modelCode;
}

</script>

</head>
<body>
<div class="board">
<form id="editReportModel" name="editReportModel" enctype="multipart/form-data"  method="post" action="<%=request.getContextPath() %>/uploadfile?method=uploadfile">
<h2 class="title">报告编写</h2>
<table cellpadding="0" cellspacing="0" style="width: 70%">
  
	<tr>
		<td>模版编号 &nbsp; <c:out value="${ReportModelImpl.modelCode}"/></td>
		<td>模版名称&nbsp;<c:out value="${ReportModelImpl.modelName}"/></td>
		<td>创建人&nbsp;<c:out value="${ReportModelImpl.inputEr}"/></td>
		<td>创建时间&nbsp;<c:out value="${ReportModelImpl.inputTime}"/></td>
		
    </tr>
   </table> 	
	<h2 class="title">风险类型</h2>
	
	<table cellpadding="0" cellspacing="0" style="width: 70%">
		 <tr>
			<c:forEach items="${risk}" var="ReportModelImpl">
				<td width="90px" style="text-align: center;"><c:out value="${ReportModelImpl.riskname.riskName}" /></td>
				<td width="150px" style="text-align:left;padding-left: 20px">			
				<c:forEach items="${ReportModelImpl.listRsk}" var="rsk">
					 <c:out value="${rsk.rskSubName}" /><br/>
				</c:forEach>
				</td>
			</c:forEach>
	    </tr>
	</table>
	
	<table cellpadding="0" cellspacing="0" style="width: 70%">
		<tr>
			<td align="center">请导入风险报告</td>
			<td colspan="1"><input type="file" name="riskReport" size="20" maxlength="80"></td>
		</tr>
	<tr>
	  <td>
	    <input type="submit" name="Submit" value="提交" />
	    <input type="hidden" name="modelCode" value="<c:out value="${ReportModelImpl.modelCode}"/>" />
        </td> <td> 
        <input type="button" onclick="show('<c:out value="${ReportModelImpl.modelCode}"/>')" value="下载模版"/>
	</td>

	</tr>
	<tr>
		<td>		<input type="button" onclick="url(<c:out value="${ReportModelImpl.modelCode}"/>)" value="风险报告下载">
		</td>
		<td>		<input type="button" onclick="fileurl(<c:out value="${ReportModelImpl.modelCode}"/>)" value="相关报告下载">
		</td>
	</tr>
</table>

</form>
</div>
	<form action="<%=request.getContextPath() %>/downloadfile?method=downloadfile" method="post">
	 <input type="hidden" name="modelCode" value="<c:out value="${ReportModelImpl.modelCode}"/>" />
	<input type="submit" value="风险报告下载111">
	</body>
	</form>
</body>
</html>
